/**
 * 财务路由
 */


import Main from '@/components/main'
import parentView from '@/components/parent-view'

const financeRouter = {
  path: '/finance',
  name: 'finance',
  meta: {
    keepAlive: true,
    icon: '_caiwubankuai',
    showAlways: true,
    access: ['Finance'],
    title: '财务管理'
  },
  component: Main,
  children: [
    {
      path: 'invoiceManage',
      name: 'invoiceManage',
      meta: {
        keepAlive: true,
        showAlways: true,
        access: ['FinanceInvoice'],
        title: '发票管理'
      },
      component: parentView,
      children: [
        {
          path: 'invoiceApply',
          name: 'invoiceApply',
          meta: {
            keepAlive: true,
            access: ['FinanceInvoiceApply'],
            title: '发票申请'
          },
          component: parentView,
          // component: () => import('@/view/finance/invoiceManage/invoiceManage.vue')
          children: [
            {
              path: 'invoiceApplyList',
              name: 'invoiceApplyList',
              meta: {
                // keepAlive: true,
                access: ['FinanceInvoiceApply'],
                title: '发票申请'
              },
              component: () => import('@/view/finance/invoiceManage/invoiceApply/invoiceApply.vue')
            }
          ]
        },
        {
          path: 'invoiceMake',
          name: 'invoiceMake',
          meta: {
            keepAlive: true,
            access: ['FinanceInvoiceManage'],
            title: '开票管理'
          },
          component: parentView,
          // component: () => import('@/view/finance/invoiceManage/invoiceManage.vue')
          children: [
            {
              path: 'invoiceMakeList',
              name: 'invoiceMakeList',
              meta: {
                access: ['FinanceInvoiceManage'],
                title: '开票管理'
              },
              component: () => import('@/view/finance/invoiceManage/invoiceMake/invoiceMake.vue')
            }
          ]
        }
      ]
    },
    {
      path: 'receivableBillManage',
      name: 'receivableBillManage',
      meta: {
        keepAlive: true,
        showAlways: true,
        access: ['FinanceReceivableBills'],
        title: '应收账单管理'
      },
      component: parentView,
      children: [
        {
          path: 'receivableBillsList',
          name: 'receivableBillsList',
          meta: {
            keepAlive: true,
            access: ['FinanceReceivableBill'],
            title: '应收账单管理'
          },
          component: () => import('@/view/finance/receivableBillManage/receivableBill/receivableBill.vue')
        },
        {
          path: 'financeReceivableBalance',
          name: 'financeReceivableBalance',
          meta: {
            keepAlive: true,
            access: ['FinanceReceivableBalanceLog'],
            title: '应收差额说明'
          },
          component: () => import('@/view/finance/receivableBillManage/receivableBill/receivableBalance.vue')
        }
      ]
    },
    {
      path: 'moneyManage',
      name: 'moneyManage',
      meta: {
        keepAlive: true,
        showAlways: true,
        access: ['FinanceFund'],
        title: '资金管理'
      },
      component: parentView,
      children: [
        {
          path: 'collectingAccount',
          name: 'collectingAccount',
          meta: {
            keepAlive: true,
            access: ['FinanceCollectingAccount'],
            title: '收款账户管理'
          },
          component: parentView,
          children: [
            {
              path: 'collectingAccountList',
              name: 'collectingAccountList',
              meta: {
                keepAlive: true,
                access: ['FinanceCollectingAccount'],
                title: '收款账户管理'
              },
              component: () => import('@/view/finance/moneyManage/collectingAccount/collectingAccount.vue')
            }
          ]
        },
        {
          path: 'payAccount',
          name: 'payAccount',
          meta: {
            keepAlive: true,
            access: ['FinancePayAccount'],
            title: '付款账户管理'
          },
          component: parentView,
          children: [
            {
              path: 'payAccountList',
              name: 'payAccountList',
              meta: {
                keepAlive: true,
                access: ['FinancePayAccount'],
                title: '付款账户管理'
              },
              component: () => import('@/view/finance/moneyManage/payAccount/payAccount.vue')
            }
          ]
        },
        {
          path: 'receivable',
          name: 'receivable',
          meta: {
            // keepAlive: true,
            access: ['FinanceReceivable'],
            title: '到款管理'
          },
          component: parentView,
          children: [
            {
              path: 'receivableList',
              name: 'receivableList',
              meta: {
                keepAlive: true,
                access: ['FinanceReceivable'],
                title: '到款管理'
              },
              component: () => import('@/view/finance/moneyManage/receivable/receivable.vue')
            }
          ]
        },
        {
          path: 'receivableClaim',
          name: 'receivableClaim',
          meta: {
            keepAlive: true,
            access: ['FinanceReceivableClaim'],
            title: '资金认领'
          },
          component: parentView,
          children: [
            {
              path: 'receivableClaimList',
              name: 'receivableClaimList',
              meta: {
                keepAlive: true,
                access: ['FinanceReceivableClaim'],
                title: '资金认领'
              },
              component: () => import('@/view/finance/moneyManage/receivableClaim/receivableClaim/receivableClaim.vue')
            },
            {
              path: 'billClaim',
              name: 'billClaim',
              meta: {
                // keepAlive: true,
                access: ['FinanceBillClaim'],
                title: '账单认领',
                hideInMenu: true
              },
              component: () => import('@/view/finance/moneyManage/receivableClaim/billClaim/billClaim.vue')
            },
            {
              path: 'treatClaim',
              name: 'treatClaim',
              meta: {
                // keepAlive: true,
                access: ['FinanceTreatmentClaim'],
                title: '待遇认领',
                hideInMenu: true
              },
              component: () => import('@/view/finance/moneyManage/receivableClaim/treatClaim/treatClaim.vue')
            }
          ]
        }
      ]
    },
    {
      path: 'customerPayable',
      name: 'customerPayable',
      meta: {
        keepAlive: true,
        showAlways: true,
        access: ['FinancePayableBill'],
        title: '客户应付管理'
      },
      component: parentView,
      children: [
        {
          path: 'ssApply',
          name: 'ssApply',
          meta: {
            keepAlive: true,
            access: ['FinanceSSPayableBillApply'],
            title: '社保付款申请'
          },
          component: parentView,
          children: [
            {
              path: 'ssApplyList',
              name: 'ssApplyList',
              meta: {
                keepAlive: true,
                access: ['FinanceSSPayableBillApply'],
                title: '社保付款申请'
              },
              component: () => import('@/view/finance/customerPayable/ssApply/ssApply.vue')
            },
            {
              path: 'ssApplyDetail',
              name: 'ssApplyDetail',
              meta: {
                keepAlive: true,
                access: ['FinanceSSPayableBillApply'],
                title: '社保付款申请明细',
                hideInMenu: true
              },
              component: () => import('@/view/finance/customerPayable/ssApply/ssApplyDetail.vue')
            },
          ]
        },
        {
          path: 'ssPayable',
          name: 'ssPayable',
          meta: {
            keepAlive: true,
            access: ['FinanceSSPayableBill'],
            title: '社保应付账单'
          },
          component: parentView,
          children: [
            {
              path: 'ssPayableList',
              name: 'ssPayableList',
              meta: {
                keepAlive: true,
                access: ['FinanceSSPayableBill'],
                title: '社保应付账单'
              },
              component: () => import('@/view/finance/customerPayable/ssPayable/ssPayable.vue')
            },
            {
              path: 'ssPayableDetail',
              name: 'ssPayableDetail',
              meta: {
                keepAlive: true,
                access: ['FinanceSSPayableBill'],
                title: '社保应付账单明细',
                hideInMenu: true
              },
              component: () => import('@/view/finance/customerPayable/ssPayable/ssPayableDetail.vue')
            },
          ]
        },
        {
          path: 'pfApply',
          name: 'pfApply',
          meta: {
            keepAlive: true,
            access: ['FinancePFPayableBillApply'],
            title: '公积金付款申请'
          },
          component: parentView,
          children: [
            {
              path: 'pfApplyList',
              name: 'pfApplyList',
              meta: {
                keepAlive: true,
                access: ['FinancePFPayableBillApply'],
                title: '公积金付款申请'
              },
              component: () => import('@/view/finance/customerPayable/pfApply/pfApply.vue')
            },
            {
              path: 'pfApplyDetail',
              name: 'pfApplyDetail',
              meta: {
                keepAlive: true,
                access: ['FinancePFPayableBillApply'],
                title: '公积金付款申请明细',
                hideInMenu: true
              },
              component: () => import('@/view/finance/customerPayable/pfApply/pfApplyDetail.vue')
            },
          ]
        },
        {
          path: 'pfPayable',
          name: 'pfPayable',
          meta: {
            keepAlive: true,
            access: ['FinancePFPayableBill'],
            title: '公积金应付账单'
          },
          component: parentView,
          children: [
            {
              path: 'pfPayableList',
              name: 'pfPayableList',
              meta: {
                keepAlive: true,
                access: ['FinancePFPayableBill'],
                title: '公积金应付账单'
              },
              component: () => import('@/view/finance/customerPayable/pfPayable/pfPayable.vue')
            },
            {
              path: 'pfPayableDetail',
              name: 'pfPayableDetail',
              meta: {
                keepAlive: true,
                access: ['FinancePFPayableBill'],
                title: '公积金应付账单明细',
                hideInMenu: true
              },
              component: () => import('@/view/finance/customerPayable/pfPayable/pfPayableDetail.vue')
            },
          ]
        },
        {
          path: 'cApply',
          name: 'cApply',
          meta: {
            keepAlive: true,
            access: ['FinanceCPayableBillApply'],
            title: '商保付款申请'
          },
          component: parentView,
          children: [
            {
              path: 'cApplyList',
              name: 'cApplyList',
              meta: {
                keepAlive: true,
                access: ['FinanceCPayableBillApply'],
                title: '商保付款申请'
              },
              component: () => import('@/view/finance/customerPayable/cApply/cApply.vue')
            },
            {
              path: 'cApplyDetail',
              name: 'cApplyDetail',
              meta: {
                keepAlive: true,
                access: ['FinanceCPayableBillApply'],
                title: '商保付款申请明细',
                hideInMenu: true
              },
              component: () => import('@/view/finance/customerPayable/cApply/cApplyDetail.vue')
            },
          ]
        },
        {
          path: 'cPayable',
          name: 'cPayable',
          meta: {
            keepAlive: true,
            access: ['FinanceCPayableBill'],
            title: '商保应付账单'
          },
          component: parentView,
          children: [
            {
              path: 'cPayableList',
              name: 'cPayableList',
              meta: {
                keepAlive: true,
                access: ['FinanceCPayableBill'],
                title: '商保应付账单'
              },
              component: () => import('@/view/finance/customerPayable/cPayable/cPayable.vue')
            },
            {
              path: 'cPayableDetail',
              name: 'cPayableDetail',
              meta: {
                keepAlive: true,
                access: ['FinanceCPayableBill'],
                title: '商保应付账单明细',
                hideInMenu: true
              },
              component: () => import('@/view/finance/customerPayable/cPayable/cPayableDetail.vue')
            },
          ]
        },
        {
          path: 'sApply',
          name: 'sApply',
          meta: {
            keepAlive: true,
            access: ['FinanceSPayableBillApply'],
            title: '薪资付款申请'
          },
          component: parentView,
          children: [
            {
              path: 'sApplyList',
              name: 'sApplyList',
              meta: {
                keepAlive: true,
                access: ['FinanceSPayableBillApply'],
                title: '薪资付款申请'
              },
              component: () => import('@/view/finance/customerPayable/sApply/sApply.vue')
            },
            {
              path: 'sApplyDetail',
              name: 'sApplyDetail',
              meta: {
                keepAlive: true,
                access: ['FinanceSPayableBillApply'],
                title: '薪资付款申请明细',
                hideInMenu: true
              },
              component: () => import('@/view/finance/customerPayable/sApply/sApplyDetail.vue')
            },
          ]
        },
        {
          path: 'sPayable',
          name: 'sPayable',
          meta: {
            keepAlive: true,
            access: ['FinanceSPayableBill'],
            title: '薪资应付账单'
          },
          component: parentView,
          children: [
            {
              path: 'sPayableList',
              name: 'sPayableList',
              meta: {
                keepAlive: true,
                access: ['FinanceSPayableBill'],
                title: '薪资应付账单'
              },
              component: () => import('@/view/finance/customerPayable/sPayable/sPayable.vue')
            },
            {
              path: 'sPayableDetail',
              name: 'sPayableDetail',
              meta: {
                keepAlive: true,
                access: ['FinanceSPayableBill'],
                title: '薪资应付账单明细',
                hideInMenu: true
              },
              component: () => import('@/view/finance/customerPayable/sPayable/sPayableDetail.vue')
            },
          ]
        },
        {
          path: 'treatmentApply',
          name: 'treatmentApply',
          meta: {
            keepAlive: true,
            access: ['FinanceTreatmentPayableApply'],
            title: '待遇付款申请'
          },
          component: parentView,
          children: [
            {
              path: 'treatmentApplyList',
              name: 'treatmentApplyList',
              meta: {
                keepAlive: true,
                access: ['FinanceTreatmentPayableApply'],
                title: '待遇付款申请'
              },
              component: () => import('@/view/finance/customerPayable/treatmentApply/treatmentApply.vue')
            }
          ]
        },
        {
          path: 'treatmentPayable',
          name: 'treatmentPayable',
          meta: {
            keepAlive: true,
            access: ['FinanceTreatmentPayableBill'],
            title: '待遇应付账单'
          },
          component: parentView,
          children: [
            {
              path: 'treatmentPayableList',
              name: 'treatmentPayableList',
              meta: {
                keepAlive: true,
                access: ['FinanceTreatmentPayableBill'],
                title: '待遇应付账单'
              },
              component: () => import('@/view/finance/customerPayable/treatmentPayable/treatmentPayable.vue')
            }
          ]
        },
        {
          path: 'expenseManage',
          name: 'expenseManage',
          meta: {
            keepAlive: true,
            access: ['FinanceReimburse'],
            title: '报销管理'
          },
          component: parentView,
          children: [
            {
              path: 'expenseManageList',
              name: 'expenseManageList',
              meta: {
                keepAlive: true,
                access: ['FinanceReimburse'],
                title: '报销管理'
              },
              component: () => import('@/view/finance/customerPayable/expenseManage/expenseManage.vue')
            }
          ]
        },
        {
          path: 'paymentDetail',
          name: 'paymentDetail',
          meta: {
            keepAlive: true,
            access: ['FinancePaymentDetails'],
            title: '付款明细管理'
          },
          component: parentView,
          children: [
            {
              path: 'paymentDetailList',
              name: 'paymentDetailList',
              meta: {
                keepAlive: true,
                access: ['FinancePaymentDetails'],
                title: '付款明细管理'
              },
              component: () => import('@/view/finance/customerPayable/paymentDetail/paymentDetail.vue')
            }
          ]
        },
        // {
        //   path: 'sPayable_old',
        //   name: 'sPayable_old',
        //   meta: {
        //     keepAlive: true,
        //     access: ['FinanceSPayableBill'],
        //     title: '薪资应付账单'
        //   },
        //   component: parentView,
        //   children: [
        //     {
        //       path: 'sPayableList_old',
        //       name: 'sPayableList_old',
        //       meta: {
        //         keepAlive: true,
        //         access: ['FinanceSPayableBill'],
        //         title: '薪资应付账单'
        //       },
        //       component: () => import('@/view/finance/customerPayable/sPayable_old/sPayable.vue')
        //     },
        //     {
        //       path: 'sPayableDetail_old',
        //       name: 'sPayableDetail_old',
        //       meta: {
        //         keepAlive: true,
        //         access: ['FinanceSPayableBill'],
        //         title: '薪资应付账单明细',
        //         hideInMenu: true
        //       },
        //       component: () => import('@/view/finance/customerPayable/sPayable_old/sPayableDetail.vue')
        //     },
        //   ]
        // },
      ]
    },
    {
      path: 'financeBalance',
      name: 'financeBalance',
      component: parentView,
      meta: {
        keepAlive: true,
        showAlways: true,
        // notCache: false,
        access: ['FinanceBalance'],
        title: '差额管理'
      },
      children: [
        {
          path: 'financeBalanceList',
          name: 'financeBalanceList',
          meta: {
            keepAlive: true,
            // notCache: false,
            access: ['FinanceBalance'],
            title: '差额管理'
          },
          component: () => import('@/view/finance/financeBalance/customerBalance.vue')
        },
        {
          path: 'customerBalanceDetailNew',
          name: 'customerBalanceDetailNew',
          meta: {
            keepAlive: true,
            notCache: true,
            title: '差额明细',
            access: ['FinanceBalance'],
            hideInMenu: true
          },
          component: () => import('@/view/finance/financeBalance/customerBalanceDetail.vue')
        },
        {
          path: 'financePayableBalance',
          name: 'financePayableBalance',
          meta: {
            keepAlive: true,
            // notCache: false,
            title: '应付差额说明',
            access: ['FinanceBalance']
          },
          component: () => import('@/view/finance/financeBalance/payableBalance.vue')
        }
      ]
    },
  ]
}

export default financeRouter;